import { User } from '../database/database'

export default {
    save : async(user) => {
        await User.upsert(user)
    },
    get : async(id) =>{
        return await User.findById(id)
    },
    countCountry : async() =>{
        return await User.aggregate('country', 'count',{ distinct : true })
    },
    countCity : async() =>{
        return await User.aggregate('city', 'count',{ distinct : true })
    },
    count : async() =>{
        return await User.count()
    }
}